package com.hnkywl.sts.action.jhgl;

import com.hnkywl.sts.entity.jhgl.Bgjh;
import com.hnkywl.sts.entity.jhgl.Bgjhhz;
import com.hnkywl.sts.entity.jhgl.Bgjhmx;
import com.hnkywl.sts.entity.organ.Nbgs;
import com.hnkywl.sts.entity.sys.Gncz;
import com.hnkywl.sts.service.jhgl.BgjhService;
import com.hnkywl.sts.service.organ.NbgsService;
import com.hnkywl.sts.service.sys.GnczService;
import com.hnkywl.sts.service.sys.YgService;
import com.hnkywl.sts.util.CalcUtils;
import com.hnkywl.sts.util.POIUtil;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import net.ruixin.web.struts2.SimpleActionSupport;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.Region;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;

import java.io.File;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-6-25
 * Time: 下午3:40
 * To change this template use File | Settings | File Templates.
 */
@Namespace("/jhgl/bgjhlr")
public class BgjhlrAction extends SimpleActionSupport {
    //ID数组
    private String ids;

    private Long id;
    //保供物资计划类型
    private String type;
    //保供计划单位Id
    private Long jhdwId;
    //供应站ID
    private Long gyzId;
    //登录用户的公司ID
    private Long ygGsId;
    //计划年份
    private Integer jhnf;
    //计划月份
    private Integer jhyf;
    //物资编码
    private String wzbm;
    //计划说明
    private String sm;
    //分页组件 起始位置
    private int page;
    //分页组件 页面大小
    private int rows;
    //保供计划
    private Bgjh bgjh;


    //保供计划明细
    private Bgjhmx bgjhmx;

    private Long bgjhmxId;
    //总公司
    private Nbgs zgs;

    private Date date;

    private Date startDate;

    private Date endDate;

    //所属设备材料搜索使用
    private String sssbcl;

    private BgjhService bgjhService;


    private NbgsService nbgsService;

    private Date dqrq;
    //功能操作
    private List<Gncz> gnczList;
    private GnczService gnczService;

    private String typeId;

    // 计划状态
    private Integer zt;

    private List<Map> mxList;

    private List<Map> cghtMxList;

    private Long hz;

    private File upload;


    @Action("bgjhlr")
    public String bgjhlr() {
        date = new Date();
        List<Nbgs> roots = nbgsService.findAllRootNbgs();
        if (!CollectionUtils.isEmpty(roots))
            zgs = roots.get(0);
        gnczList = gnczService.findGnczByJsAndUrl(request.getServletPath());
        return SUCCESS;
    }


    @Action("bgjhlrList")
    public void bgjhlrList() {
        if (startDate != null)
            startDate = convertDate(startDate, true);
        if (endDate != null)
            endDate = convertDate(endDate, false);
        renderText(bgjhService.findList(type, jhdwId, gyzId, jhnf, jhyf, startDate, endDate, wzbm, sm, sssbcl, page, rows));
    }

    @Action("bgjhLists")
    public void bgjhLists() {
        renderText(bgjhService.findBgjhByBgjhhzIdList(id, page, rows));
    }

    @Actions({@Action("bgjhlr_content"), @Action("bgjhlr_detail")})
    public String bgjhlrContent() {
        date = new Date();
        GregorianCalendar gc = new GregorianCalendar();
        gc.add(GregorianCalendar.MONTH, 1);
        dqrq = gc.getTime();
        ygGsId = YgService.getCurrentYgZgGsId();
        if (id != null) {
            bgjh = bgjhService.find(id);
        }
        return SUCCESS;
    }

    @Action("checkWzmx")
    public void checkWzmx() {
        Boolean flag = this.bgjhService.checkWzmx(id, wzbm);
        if (flag)
            renderJson("{\"statusCode\":\"200\", \"message\":\"录入物资明细成功!\"}");
        else
            renderJson("{\"statusCode\":\"300\", \"message\":\"明细中有重复的物资，无法重复录入!\"}");
    }

    @Action("bgjhmxList")
    public void bgjhmxList() {
        renderJson(bgjhService.findBgjhmxByBgjh(id));
    }

    @Action("findThBgjhmxByBgjh")
    public void findThBgjhmxByBgjh() {
        renderJson(bgjhService.findThBgjhmxByBgjh(id));
    }

    // 保供物资计划明细
    @Action("bgjhmx")
    public String bgjhmx() {
        mxList = bgjhService.findBgjhmxByBgjhId(id, hz);
        return SUCCESS;
    }

    //保供计划明细detail
    @Action("bgjhhzmxdetail")
    public void bgjhhzmxdetail() {
        renderText(bgjhService.findBgjhmxByBgjhIds(id, hz, typeId, page, rows));
    }

    //保供计划明细导出
    @Action("bgjhhzmx_exp")
    public String bgjhhzmx_exp() {
//        SimpleDateFormat dateformat=new SimpleDateFormat("yyyy-MM-dd");
        List<Map> result = bgjhService.findBgjhmxByBgjhIds(id, hz, typeId);
        String filename = "保供计划明细.xls";
        if (hz != null && hz == 0) {
            Bgjh jh = bgjhService.find(id);
            filename = jh.getSm() + ".xls";
        } else {
            Bgjhhz jhhz = bgjhService.findhz(id);
            filename = jhhz.getSm() + ".xls";
        }
        //第一步，创建一个webbook，对应一个Excel文件
        HSSFWorkbook wb = new HSSFWorkbook();
        //第二步，在webbook中添加一个sheet,对应Excel文件中的sheet
        HSSFSheet sheet = wb.createSheet("sheet1");
        POIUtil poiUtil = new POIUtil(wb);
        //设置列宽
        sheet.setDefaultRowHeightInPoints(15);
        sheet.setDefaultColumnWidth((short) 15);
        HSSFCellStyle titleStyle = poiUtil.createHeader3HSSFCellStyle(wb);
        if (hz == 0 && (typeId == null || !typeId.equals("2"))) {
            poiUtil.fillRow(sheet, titleStyle, 0, "物资编码", "物资名称", "规格型号", "图号", "单位", "计划数量", "到货日期", "设备材料", "计划员", "是否退回", "备注");
            for (int i = 1; i < result.size() + 1; i++) {
                Map item = result.get(i - 1);
                poiUtil.fillRow(sheet, null, i, item.get("wzgg.oldcode"), item.get("wzgg.name"),
                        item.get("wzgg.ggxh"), item.get("wzgg.th"), item.get("dw"), item.get("jhsl"),
                        item.get("dhrq"), item.get("sbcl"),
                        item.get("jhy"), ((BigDecimal) item.get("zt")).intValue() == 1 ? "否" : "是",
                        item.get("bz"));
            }
        } else {
            poiUtil.fillRow(sheet, titleStyle, 0, "物资编码", "物资名称", "规格型号", "图号", "单位", "类型", "计划数量", "库存数量", "一级平衡数量", "二级平衡数量", "上报数量", "到货日期",
                    "设备材料", "备注", "计划员", "提交人", "提交时间 ", "汇总人", "汇总时间", "供应站处理人", "供应站处理时间", "业务科处理人", "业务科处理时间",
                    "状态", "合同编码", "采购单号", "验收人", "验收时间");
            for (int i = 1; i < result.size() + 1; i++) {
                Map item = result.get(i - 1);
                String zt = "";
                switch (((BigDecimal) item.get("zt")).intValue()) {
                    case 1:
                        zt = "已汇总";
                        break;
                    case 2:
                        zt = "已提交供应站";
                        break;
                    case 3:
                        zt = "供应站已处理";
                        break;
                    case 4:
                        zt = "业务科已处理";
                        break;
                    case 5:
                        zt = "正在提交";
                        break;
                    case 6:
                        zt = "已经提交至物供";
                        break;
                    case 7:
                        zt = "计划科已处理";
                        break;
                    case 8:
                        zt = "采购单已办理";
                        break;
                    case 10:
                        zt = "已退回";
                }
                poiUtil.fillRow(sheet, null, i, item.get("wzgg.oldcode"), item.get("wzgg.name"),
                        item.get("wzgg.ggxh"), item.get("wzgg.th"), item.get("dw"), item.get("cgfs"), item.get("jhsl"),
                        item.get("kcsl"), item.get("sl1"), item.get("sl2"), item.get("sbsl"),
                        item.get("dhrq"), item.get("sbcl"), item.get("bz"), item.get("hzr"),
                        item.get("hzr"), item.get("hzsj"), item.get("hzr"), item.get("hzsj"),
                        item.get("gyzclr"), item.get("gyzclsj"), item.get("ywkclr"), item.get("ywkclsj"),
                        zt, item.get("htbm"), item.get("cgdh"), item.get("ysr"), item.get("yssj"));
            }
        }
        try {
            response.setContentType("application/x-download");
            String filedisplay = new String((filename).getBytes("gb2312"), "iso8859-1");
            response.addHeader("Content-Disposition", "attachment;filename=" + filedisplay);
            wb.write(response.getOutputStream());
            response.getOutputStream().close();
        } catch (Exception e) {
            e.printStackTrace();
            renderText("位置异常，导出失败" + e.getMessage());
        }
        return null;
    }

    // 保供物资计划汇总明细
    @Action("findWzjhhzmxByBgjhId")
    public void findWzjhhzmxByBgjhId() {
        renderText(bgjhService.findWzjhhzmxByBgjhId(typeId, id));
    }

    // 查询是否已经存在合同
    @Action("findHtxxByBgjhId")
    public void findHtxxByBgjhId() {
        renderText(bgjhService.findHtxxByBgjhId(typeId, id));
    }

    //采购合同detail
    @Action("bgjhlrcghtdetail")
    public void bgjhlrcghtdetail() {
        renderText(bgjhService.findHtxxByBgjhIds(typeId, id, page, rows));
    }

    // 查询是否已经建立采购单
    @Action("findCgdBybgjhId")
    public void findCgdBybgjhId() {
        renderText(bgjhService.findCgdBybgjhId(typeId, id));
    }

    // 查询是否已经建立采购单detail
    @Action("findCgdBybgjhIddetail")
    public void findCgdBybgjhIddetail() {
        renderText(bgjhService.findCgdBybgjhIds(typeId, id, page, rows));
    }


    @Action("save_bgjhlr")
    public void save() {
        try {
            bgjhService.save(bgjh);
            renderText("{\"statusCode\":\"200\", \"message\":\"保存保供物资计划成功!\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("edit")
    public void edit() {
        try {
            bgjhService.edit(bgjh);
            renderText("{\"statusCode\":\"200\", \"message\":\"保存保供物资计划成功!\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("saveMx")
    public void saveMx() {
        try {
            Long id = bgjhService.saveMx(bgjhmx);
            renderJson("{\"mxid\":" + id + ",\"statusCode\":\"200\", \"message\":\"保存保供物资计划成功!\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderJson("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("delMx")
    public void delMx() {
        try {
            bgjhService.delMx(bgjhmxId);
            renderText("{\"statusCode\":\"200\", \"message\":\"删除保供物资计划成功!\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("mxth")
    public void mxTh() {
        try {
            bgjhService.mxTh(bgjhmxId);
            renderText("{\"statusCode\":\"200\", \"message\":\"已退回物资计划!\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("submit")
    public void submit() {
        try {
            bgjhService.submit(convertId(ids));
            renderJson("{\"statusCode\":\"200\", \"message\":\"操作成功!\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderJson("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("collect")
    public void collect() {
        try {
            bgjhService.collect(convertId(ids));
            renderJson("{\"statusCode\":\"200\", \"message\":\"操作成功!\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderJson("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("delete")
    public void delete() {
        try {
            bgjhService.delete(convertId(ids));
            renderJson("{\"statusCode\":\"200\", \"message\":\"操作成功!\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderJson("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("reject")
    public void reject() {
        try {
            bgjhService.reject(convertId(ids));
            renderJson("{\"statusCode\":\"200\", \"message\":\"操作成功!\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderJson("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("bgjhmx_upload")
    public String bgjhmxUpload() {
        return SUCCESS;
    }

    /**
     * 攀钢物资明细导入
     */
    @Action("bgjhmx_import")
    public void bgjhmxImport() {
        Integer row = 0;
        try {
            Workbook book = Workbook.getWorkbook(upload);
            //  获得第一个工作表对象
            Sheet sheet = book.getSheet(0);
            //获取总行数
            int rows = sheet.getRows();
            String check = "0";
            String xsxt_htbm;
            String xsxt_xsdh;
            String sfhdj;
            String name = "";
            String cz = "";
            String ggxh = "";
            String jhrq;
            String jszl;
            String hsj;
            String hse;
            List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
            for (int i = 1; i < rows; i++) { //从第2行开始导入
                row = i + 1;
                Map<String, String> map = new HashMap<String, String>();
                if (checkResult(sheet.getCell(0, i), false)) {
                    xsxt_xsdh = sheet.getCell(0, i).getContents().toString();//销售合同子项号
                    map.put("xsxt_xsdh", xsxt_xsdh);
                } else {
                    check = "1";
                    break;
                }
                if (checkResult(sheet.getCell(1, i), false)) {
                    xsxt_htbm = sheet.getCell(1, i).getContents().toString();//销售合同号
                    map.put("xsxt_htbm", xsxt_htbm);
                } else {
                    check = "1";
                    break;
                }
                if (checkResult(sheet.getCell(2, i), false)) {
                    name = sheet.getCell(2, i).getContents().toString();//品名
                    map.put("name", name);
                } else {
                    check = "1";
                    break;
                }
                if (checkResult(sheet.getCell(3, i), false)) {
                    cz = sheet.getCell(3, i).getContents().toString();//材质
                    map.put("cz", cz);
                } else {
                    check = "1";
                    break;
                }
                if (checkResult(sheet.getCell(4, i), false)) {
                    ggxh = sheet.getCell(4, i).getContents().toString();//规格型号
                    map.put("ggxh", ggxh);
                } else {
                    check = "1";
                    break;
                }
                if (checkResultDate(sheet.getCell(5, i))) {
                    jhrq = sheet.getCell(5, i).getContents().toString();//计划时间
                    map.put("jhrq", jhrq);
                } else {
                    check = "1";
                    break;
                }
                if (checkResult(sheet.getCell(6, i), true)) {
                    jszl = sheet.getCell(6, i).getContents().toString();//订货量
                    map.put("jszl", jszl);
                } else {
                    check = "1";
                    break;
                }
                if (checkResult(sheet.getCell(7, i), true)) {
                    hsj = sheet.getCell(7, i).getContents().toString();//含税价
                    map.put("hsj", hsj);
                } else {
                    check = "1";
                    break;
                }
                if (checkResult(sheet.getCell(8, i), true)) {
                    hse = sheet.getCell(8, i).getContents().toString();//金额
                    map.put("hse", hse);
                } else {
                    check = "1";
                    break;
                }
                if (checkResult(sheet.getCell(9, i), false)) {
                    sfhdj = sheet.getCell(9, i).getContents().toString();//是否后定价
                    map.put("sfhdj", sfhdj);
                } else {
                    check = "1";
                    break;
                }

                if (!bgjhService.checkGG(name, ggxh, cz)) {
                    check = "2";
                    break;
                }
                listMap.add(map);
            }
            if (StringUtils.equals(check, "0")) {
                bgjhService.saveUploadBgjhmx(id, listMap);
                renderText("{\"statusCode\":\"200\", \"message\":\"批量导入成功！\"}");
            } else if (StringUtils.equals(check, "1")) {
                String str = "第（" + row + "）行错误，";
                renderText("{\"statusCode\":\"300\", \"message\":\"" + str + "可能为空，可能不是数字，日期应该为：20150808格式！" + "\"}");
            } else {
                String str = "第（" + row + "）行错误，";
                renderText("{\"statusCode\":\"300\", \"message\":\"" + str + "运营系统没有品名：[" + name + "]材质为：[" + cz + "]规格：[" + ggxh + "] \"}");
            }
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"数据异常：" + e.getMessage().replace("\"", " ") + "\"}");
        }
    }

    /**
     * 判断日期是否正确
     *
     * @param cell
     * @return
     */
    private boolean checkResultDate(Cell cell) {
        if (null != cell && null != cell.getContents() && org.apache.commons.lang3.StringUtils.isNotBlank(cell.getContents().toString())) {
            try {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
                sdf.parse(cell.getContents().toString());
                return true;
            } catch (Exception e) {

            }
        }
        return false;
    }

    /**
     * 判断格式是否正确
     *
     * @param cell
     * @param bool
     * @return
     */
    private boolean checkResult(Cell cell, boolean bool) {
        if (null != cell && null != cell.getContents() && org.apache.commons.lang3.StringUtils.isNotBlank(cell.getContents().toString())) {
            if (bool) {
                try {
                    Double dd = Double.valueOf(cell.getContents().toString());
                    if (dd <= 0) {
                        return false;
                    } else {
                        return true;
                    }
                } catch (Exception e) {

                }
            } else {
                return true;
            }
        }
        return false;
    }

    /**
     * 攀钢物资明细导出模板
     *
     * @return
     */
    @Action("bgjhmx_export")
    public String bgjhmx_export() {
        //第一步，创建一个webbook，对应一个Excel文件
        HSSFWorkbook wb = new HSSFWorkbook();
        //第二步，在webbook中添加一个sheet,对应Excel文件中的sheet
        HSSFSheet sheet = wb.createSheet("sheet1");
        POIUtil poiUtil = new POIUtil(wb);
        //设置列宽
        sheet.setDefaultRowHeightInPoints(15);
        sheet.setDefaultColumnWidth((short) 12);
        sheet.setColumnWidth((short) 0, (short) (20 * 200));
        sheet.setColumnWidth((short) 1, (short) (20 * 200));
        sheet.setColumnWidth((short) 2, (short) (20 * 200));
        sheet.setColumnWidth((short) 3, (short) (20 * 200));
        sheet.setColumnWidth((short) 4, (short) (20 * 200));
        sheet.setColumnWidth((short) 5, (short) (20 * 200));
        sheet.setColumnWidth((short) 6, (short) (20 * 200));
        sheet.setColumnWidth((short) 7, (short) (20 * 200));
        sheet.setColumnWidth((short) 8, (short) (20 * 200));
        sheet.setColumnWidth((short) 9, (short) (20 * 250));
        //第三步，在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
        HSSFRow row = sheet.createRow((int) 0);
        row.setHeightInPoints(36);
        //第四步，创建单元格，并设置值表头  设置表头居中
//        HSSFCellStyle titleStyle = poiUtil.createTitleHSSFCellStyle(wb);
//        HSSFCell titleCell = row.createCell((short) 0);
//        titleCell.setCellStyle(titleStyle);
//        titleCell.setEncoding(HSSFCell.ENCODING_UTF_16);
//        titleCell.setCellValue("攀钢物资明细导入模板");
//        sheet.addMergedRegion(new Region(0, (short) 0, 0, (short) 2));
        //生成第一行数据...表头
        HSSFCellStyle headerStyle = poiUtil.createHeader3HSSFCellStyle(wb);
        poiUtil.fillRow(sheet, headerStyle, 0, "销售订单子项号", "订单号", "品名", "材质", "规格", "约定交期(yyyyMMdd)", "订货量", "合同含税单价", "合同总额","是否后定价(是/否)");
        //生成从第二行开始的企业机构数据
        try {
            response.setContentType("application/x-download");
            String filedisplay = new String(("攀钢物资明细导入模板.xls").getBytes("gb2312"), "iso8859-1");
            response.addHeader("Content-Disposition", "attachment;filename=" + filedisplay);
            wb.write(response.getOutputStream());
            response.getOutputStream().close();
        } catch (Exception e) {
            e.printStackTrace();
            renderText("位置异常，导出失败" + e.getMessage());
        }
        return null;
    }

    private List<Long> convertId(String ids) {
        List<String> temp = Arrays.asList(ids.split(","));
        List<Long> result = new ArrayList<Long>();
        for (String id : temp) {
            result.add(Long.parseLong(id));
        }
        return result;
    }

    /**
     * @param date
     * @param flag true:当天00:00:00   false:第二天00:00:00
     * @return
     */
    private Date convertDate(Date date, boolean flag) {
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(date);
        if (!flag)
            gc.add(GregorianCalendar.DAY_OF_MONTH, 1);
        gc.set(GregorianCalendar.HOUR, 0);
        gc.set(GregorianCalendar.MINUTE, 0);
        gc.set(GregorianCalendar.SECOND, 0);
        return gc.getTime();
    }

    //==============getter setter=================

    public Bgjh getBgjh() {
        return bgjh;
    }

    public void setBgjh(Bgjh bgjh) {
        this.bgjh = bgjh;
    }

    public Bgjhmx getBgjhmx() {
        return bgjhmx;
    }

    public void setBgjhmx(Bgjhmx bgjhmx) {
        this.bgjhmx = bgjhmx;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getBgjhmxId() {
        return bgjhmxId;
    }

    public void setBgjhmxId(Long bgjhmxId) {
        this.bgjhmxId = bgjhmxId;
    }

    //=================getter==================

    public Date getDate() {
        return date;
    }

    public Nbgs getZgs() {
        return zgs;
    }

    public List<Gncz> getGnczList() {
        return gnczList;
    }

    public List<Map> getMxList() {
        return mxList;
    }
//=================setter==================

    public void setIds(String ids) {
        this.ids = ids;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setJhdwId(Long jhdwId) {
        this.jhdwId = jhdwId;
    }

    public void setGyzId(Long gyzId) {
        this.gyzId = gyzId;
    }

    public Long getYgGsId() {
        return ygGsId;
    }

    public void setYgGsId(Long ygGsId) {
        this.ygGsId = ygGsId;
    }

    public void setJhnf(Integer jhnf) {
        this.jhnf = jhnf;
    }

    public void setJhyf(Integer jhyf) {
        this.jhyf = jhyf;
    }

    public void setWzbm(String wzbm) {
        this.wzbm = wzbm;
    }

    public void setSm(String sm) {
        this.sm = sm;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public void setZgs(Nbgs zgs) {
        this.zgs = zgs;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Date getDqrq() {
        return dqrq;
    }

    public String getSssbcl() {
        return sssbcl;
    }

    public void setSssbcl(String sssbcl) {
        this.sssbcl = sssbcl;
    }

    public void setDqrq(Date dqrq) {
        this.dqrq = dqrq;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Integer getZt() {
        return zt;
    }

    public Long getHz() {
        return hz;
    }

    public void setHz(Long hz) {
        this.hz = hz;
    }

    public void setZt(Integer zt) {
        this.zt = zt;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public List<Map> getCghtMxList() {
        return cghtMxList;
    }

    public void setCghtMxList(List<Map> cghtMxList) {
        this.cghtMxList = cghtMxList;
    }

    public File getUpload() {
        return upload;
    }

    public void setUpload(File upload) {
        this.upload = upload;
    }

    @Autowired
    public void setBgjhService(BgjhService bgjhService) {
        this.bgjhService = bgjhService;
    }

    @Autowired
    public void setNbgsService(NbgsService nbgsService) {
        this.nbgsService = nbgsService;
    }

    @Autowired
    public void setGnczService(GnczService gnczService) {
        this.gnczService = gnczService;
    }

}
